package com.hmall.clients;

import com.hmall.common.dto.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Description ItemClient
 * @Author dmx
 * @Date 2024-11-16
 */
@RequestMapping("/item")
@FeignClient("itemservice")
public interface ItemClient {
    @GetMapping("/{id}")
     Item save(@PathVariable Long id);

    @PutMapping("/stock/{itemId}/{num}")
     void updateStock(@PathVariable Long itemId,
                            @PathVariable Integer num
    );
}
